{extend name="base/common"}

{block name="style"}
<style type="text/css">
	.form-group textarea{
		width: 100%;
		height: 100px;
	}
</style>
{/block}

{block name="page-header"}
<div class="row wrapper border-bottom white-bg page-heading">
	<div class="col-lg-10">
		<h2>{$info['id']?'编辑':'新增'}配置</h2>
		<ol class="breadcrumb">
			<li>
				<a href="index.html">Config</a>
			</li>
			<li class="active">
				<strong>{$info['id']?'Edit':'Add'}</strong>
			</li>
		</ol>
	</div>
	<div class="col-lg-2">

	</div>
</div>
{/block}

{block name="main"}
<div class="wrapper wrapper-content animated fadeInRight">
	<div class="ibox float-e-margins">
		<div class="ibox-title">
			<h5>编辑配置信息</h5>
			<div class="ibox-tools">
				<a href="javascript:window.history.go(-1);" class="btn btn-primary btn-xs"><i class="fa fa-reply"></i> 返回</a>
			</div>
		</div>
		<div class="ibox-content">
			<form action="{:Url()}" method="post" class="form-horizontal">
				<div class="form-group">
					<label class="col-sm-2 control-label">配置标识</label>
					<div class="col-sm-10">
						<input type="text" class="form-control form_title" name="name" value="{$info.name|default=''}">
						<span class="help-block m-b-none">用于C函数调用，只能使用英文且不能重复</span>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">配置标题</label>
					<div class="col-sm-10">
						<input type="text" class="form-control form_title" name="title" value="{$info.title|default=''}">
						<span class="help-block m-b-none">用于后台显示的配置标题</span>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">排序</label>
					<div class="col-sm-10">
						<input type="text" class="form-control form_title" name="sort" value="{$info.sort|default=0}">
						<span class="help-block m-b-none">用于分组显示的顺序</span>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">配置类型</label>
					<div class="col-sm-10">
						<select class="form-control" name="type">
							{volist name="Think.config.CONFIG_TYPE_LIST" id="type"}
							<option value="{$key}" {eq name="info.type" value="$key"}selected{/eq}>{$type}</option>
							{/volist}
						</select>
						<span class="help-block m-b-none">系统会根据不同类型解析配置值</span>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">配置分组</label>
					<div class="col-sm-10">
						<select class="form-control" name="group">
							<option value="0">不分组</option>
							{volist name="Think.config.CONFIG_GROUP_LIST" id="group"}
							<option value="{$key}" {eq name="info.group" value="$key"}selected{/eq}>{$group}</option>
							{/volist}
						</select>
						<span class="help-block m-b-none">配置分组 用于批量设置 不分组则不会显示在系统设置中</span>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">配置值</label>
					<div class="col-sm-10">
							<textarea name="value" class="form-control">{$info.value|default=''}</textarea>
						<span class="help-block m-b-none">配置值</span>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">配置项</label>
					<div class="col-sm-10">
						<textarea name="extra" class="form-control">{$info.extra|default=''}</textarea>
						<span class="help-block m-b-none">如果是枚举型 需要配置该项</span>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">说明</label>
					<div class="col-sm-10">
						<textarea name="remark" class="form-control">{$info.remark|default=''}</textarea>
						<span class="help-block m-b-none">配置详细说明</span>
					</div>
				</div>
				<div class="hr-line-dashed"></div>
				<div class="form-group">
					<div class="col-sm-4 col-sm-offset-2">
						<input type="hidden" name="id" value="{$info.id|default=''}">
						<button class="btn" onclick="javascript:history.back(-1);return false;">返 回</button>
						<button class="btn btn-primary ajax-post" id="submit" type="submit" target-form="form-horizontal">确 定</button>
					</div>
				</div>
			</form>
		</div>
	</div>
</div>
{/block}

{block name="script"}
<script type="text/javascript">
	highlight_subnav("{:Url('Config/index')}");
</script>
{/block}
